package com.longxiao.enums;

import java.text.SimpleDateFormat;
import java.util.Date;

public enum SysConfigKey {
	
	MIN_LEVEL("最低等级"),
	
	MAX_LEVEL("最高等级"),

	DAILY("日常任务"),
	
	GIFT_3("连续三日完成任务奖励CP"),
	
	GIFT_7("连续七日完成任务奖励CP"),
	
	TASK_TEACHING("老师完成授课奖励CP"),
	
	TASK_COMMENTS_TEACHER("学生评价老师奖励CP"),
	
	TASK_TEACHER_PRAISE("老师获得5星好评奖励CP"),
	
	TASK_STU_PRACTICE("学生完成练习题奖励CP"),
	
	TASK_STU_PRACTICE_TAR_3("达成一个三星练习奖励CP"),
	
	TASK_STU_CURRICULUM("学习完一套课程"),
	
	TASK_STU_CURRICULUM_TEST("通过一个课程难度的结业测试"),
	
	TASK_DAY_TARGET("每日任务目标CP"),

	STU_CANCEL_CP("学生取消上课扣除CP"),
	
	STU_FINISH_CLASS_CP("学生完成上课内容奖励CP"),
	STU_UN_FINISH_CLASS_CP("学生未完成上课内容扣除CP"),
	
	TCH_UN_FINISH_CLASS_CP("老师未完成上课内容扣除CP"),

	TCH_CANCEL_CP("老师取消上课扣除CP"),

	TCH_REWARD_CP_08_00("老师上课奖励CP"),
	TCH_REWARD_CP_08_30("老师上课奖励CP"),
	TCH_REWARD_CP_09_00("老师上课奖励CP"),
	TCH_REWARD_CP_09_30("老师上课奖励CP"),
	TCH_REWARD_CP_10_00("老师上课奖励CP"),
	TCH_REWARD_CP_10_30("老师上课奖励CP"),
	TCH_REWARD_CP_11_00("老师上课奖励CP"),
	TCH_REWARD_CP_11_30("老师上课奖励CP"),
	TCH_REWARD_CP_12_00("老师上课奖励CP"),
	TCH_REWARD_CP_12_30("老师上课奖励CP"),
	TCH_REWARD_CP_13_00("老师上课奖励CP"),
	TCH_REWARD_CP_13_30("老师上课奖励CP"),
	TCH_REWARD_CP_14_00("老师上课奖励CP"),
	TCH_REWARD_CP_14_30("老师上课奖励CP"),
	TCH_REWARD_CP_15_00("老师上课奖励CP"),
	TCH_REWARD_CP_15_30("老师上课奖励CP"),
	TCH_REWARD_CP_16_00("老师上课奖励CP"),
	TCH_REWARD_CP_16_30("老师上课奖励CP"),
	TCH_REWARD_CP_17_00("老师上课奖励CP"),
	TCH_REWARD_CP_17_30("老师上课奖励CP"),
	TCH_REWARD_CP_18_00("老师上课奖励CP"),
	TCH_REWARD_CP_18_30("老师上课奖励CP"),
	TCH_REWARD_CP_19_00("老师上课奖励CP"),
	TCH_REWARD_CP_19_30("老师上课奖励CP"),
	TCH_REWARD_CP_20_00("老师上课奖励CP"),
	TCH_REWARD_CP_20_30("老师上课奖励CP"),
	TCH_REWARD_CP_21_00("老师上课奖励CP"),
	TCH_REWARD_CP_21_30("老师上课奖励CP"),
	TCH_REWARD_CP_22_00("老师上课奖励CP"),
	TCH_REWARD_CP_22_30("老师上课奖励CP"),
	TCH_REWARD_CP_23_00("老师上课奖励CP"),
	TCH_REWARD_CP_23_30("老师上课奖励CP"),

	ICE_CONFIG_INFO("ICE服务器配置"),
	ENTER_BEFORE_START_CLASS("开课前可以进入课堂分钟数"),
	
	CHAPTER_FILE_LOCAL("上传文件存储的本地路径前缀"),
	CHAPTER_FILE_HTTP("上传文件http地址前缀"),
	USER_FILE_LOCAL("用户上传图片本地目录前缀"),
	USER_FILE_HTTP("用户上传图片http前缀"),
	MINUTES_BEFORE_FINISH_CLASS("下课前几分钟方可结束课程"),
	TCH_NO_COMMENT_STU("老师未在规定时间内评价学生"),
	;
	
	
	private String descr;
	
	private SysConfigKey(String descr) {
		this.descr = descr;
	}

	public String getDescr() {
		return descr;
	}
	
	public static SysConfigKey getSysConfigKeyByTime(Date date) {
		SimpleDateFormat format = new SimpleDateFormat("hh_mm");
		String time = format.format(date);
		String preKey = "TCH_REWARD_CP_";
		SysConfigKey[] configKeys = values();
		for(SysConfigKey key : configKeys) {
			String keyName = key.name();
			if(keyName.equals(preKey + time)) {
				return key;
			}
		}
		return null;
	}
}
